import type { RouteRecordRaw } from 'vue-router';

import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    meta: {
      icon: 'ic:baseline-home-work',
      keepAlive: true,
      order: 1,
      title: $t('mes.meswm.title'),
    },
    name: 'Mes/wm',
    path: '/mes/wm',
    children: [
      {
        meta: {
          title: $t('mes.meswm.children.area.title'),
          hideInMenu: true,
        },
        name: 'Area',
        path: 'area/index',
        component: () => import('#/views/mes/wm/area/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.location.title'),
          hideInMenu: true,
        },
        name: 'Location',
        path: 'location/index',
        component: () => import('#/views/mes/wm/location/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Warehouse.title'),
          icon: 'ic:baseline-pending-actions',
        },
        name: 'Warehouse',
        path: 'warehouse',
        component: () => import('#/views/mes/wm/warehouse/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Wmstock.title'),
          icon: 'ic:baseline-bar-chart',
        },
        name: 'Wmstock',
        path: 'wmstock',
        component: () => import('#/views/mes/wm/wmstock/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Arrivalnotice.title'),
          icon: 'ic:sharp-wechat',
        },
        name: 'Arrivalnotice',
        path: 'arrivalnotice',
        component: () => import('#/views/mes/wm/arrivalnotice/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Itemrecpt.title'),
          icon: 'ic:baseline-edit-note',
        },
        name: 'Itemrecpt',
        path: 'itemrecpt',
        component: () => import('#/views/mes/wm/itemrecpt/index.vue'),
      },

      {
        meta: {
          title: $t('mes.meswm.children.Rtvendor.title'),
          icon: 'ic:outline-share',
        },
        name: 'Rtvendor',
        path: 'rtvendor',
        component: () => import('#/views/mes/wm/rtvendor/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Issue.title'),
          icon: 'ic:outline-edit-location',
        },
        name: 'Issue',
        path: 'issue',
        component: () => import('#/views/mes/wm/issue/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Rtissue.title'),
          icon: 'ic:outline-perm-contact-calendar',
        },
        name: 'Rtissue',
        path: 'rtissue',
        component: () => import('#/views/mes/wm/rtissue/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Productrecpt.title'),
          icon: 'ic:baseline-shopping-cart',
        },
        name: 'Productrecpt',
        path: 'productrecpt',
        component: () => import('#/views/mes/wm/productrecpt/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Salesnotice.title'),
          icon: 'ic:sharp-wechat',
        },
        name: 'Salesnotice',
        path: 'salesnotice',
        component: () => import('#/views/mes/wm/salesnotice/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Productsales.title'),
          icon: 'ic:baseline-flight-takeoff',
        },
        name: 'Productsales',
        path: 'productsales',
        component: () => import('#/views/mes/wm/productsales/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Rtsales.title'),
          icon: 'ic:outline-ios-share',
        },
        name: 'Rtsales',
        path: 'rtsales',
        component: () => import('#/views/mes/wm/rtsales/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Transfer.title'),
          icon: 'ic:twotone-format-list-numbered',
        },
        name: 'Transfer',
        path: 'transfer',
        component: () => import('#/views/mes/wm/transfer/index.vue'),
      },
      {
        meta: {
          title: $t('mes.meswm.children.Stocktaking.title'),
          icon: 'ic:twotone-format-list-bulleted',
        },
        name: 'Stocktaking',
        path: 'stocktaking',
        redirect: { name: 'StocktakingDefault' },
        children: [
          {
            name: 'StocktakingDefault',
            meta: {
              title: $t('mes.meswm.children.Stocktaking.Stocktaking.title'),
              icon: 'ic:sharp-calendar-month',
            },
            path: 'stocktaking', // 不要以 / 开头
            component: () =>
              import('#/views/mes/wm/stocktaking/stocktaking/index.vue'),
          },
          {
            meta: {
              title: $t('mes.meswm.children.Stocktaking.StocktakingPlan.title'),
              icon: 'ic:outline-touch-app',
            },
            path: 'stocktakingplan', // 不要以 / 开头
            component: () =>
              import('#/views/mes/wm/stocktaking/stocktakingplan/index.vue'),
          },
        ],
      },
      {
        name: 'Packages',
        path: 'packages',
        component: () => import('#/views/mes/wm/packages/index.vue'),
        meta: {
          title: $t('mes.meswm.children.Package.title'),
          icon: 'ic:baseline-backup-table',
        },
      },
      {
        name: 'Barcode',
        path: 'barcode',
        component: () => import('#/views/mes/wm/barcode/index.vue'),
        meta: {
          title: $t('mes.meswm.children.Barcode.title'),
          icon: 'ic:round-qr-code-scanner',
        },
      },
      {
        name: 'Sn',
        path: 'sn',
        component: () => import('#/views/mes/wm/sn/index.vue'),
        meta: {
          title: $t('mes.meswm.children.Sn.title'),
          icon: 'ic:round-format-italic',
        },
      },
      {
        name: 'Outsourceissue',
        path: 'outsourceissue',
        component: () => import('#/views/mes/wm/outsourceissue/index.vue'),
        meta: {
          title: $t('mes.meswm.children.Outsourceissue.title'),
          icon: 'ic:twotone-arrow-outward',
        },
      },
      {
        name: 'Outsourcerecpt',
        path: 'outsourcerecpt',
        component: () => import('#/views/mes/wm/outsourcerecpt/index.vue'),
        meta: {
          title: $t('mes.meswm.children.Outsourcerecpt.title'),
          icon: 'ic:round-content-paste-search',
        },
      },
    ],
  },
];

export default routes;
